home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / gnu / gnushogi.lha / gnushogi-1.1 / doc / BOOKFILES next >
Text File  |  1993-04-07  |  5KB  |  138 lines

  1. Binary book files
  2. -----------------
  3.  
  4. In Gnushogi the book file is a binary file.
  5. The primary book file is "gnuchess.book.data". It is intended that text book files will only be 
  6. used to generate the binary file (see remarks about syntax below).
  7.  
  8. The GDX based bookfile is the standard binary bookfile and should be used. This means the -DGDX
  9. compile option should be used and the instructions for generating a GDX book followed. The Makefile
  10. will generate a GDX book for the basic gnushogi.book text file if "make install" is entered or
  11. if "make gnushogi.book.data" is entered. Larger opening databases can be created using the opening
  12. data in the misc directory. If you use other than GDX based books follow the instructions below.
  13.  
  14. COMPILE TIME
  15.  
  16. There are two choices for the binary book file at compile time. 
  17.  
  18. Compile option -DGDX creates a random file based book file. It is space efficient
  19. medium fast to generate, and allows large books.
  20.  
  21. If neither of the above options is choosen the memory based book is generated.
  22. The size of the book is then dependent on the memory you have available.
  23.  
  24.  
  25. Creating a Binary book file.
  26.  
  27.  
  28.  
  29. *GDX based.
  30.  
  31. GDX based creates a disk based hash file. You must specify the size of the file.
  32. It is the most efficient book to use.
  33.  
  34.     gnushogir -b textfile -B binaryfile -S #entries [-P plys]
  35.  
  36. "#entries" is the number of unique position/move combinations  that will be kept plus an extra 20-30%
  37. since this is a hashfile. The size of the file will be:
  38.  
  39.     12 + (#entries)*14
  40.  
  41. A book with 528k moves which resulted in 319k entries. There can be
  42. multiple entries for a position. I put this in a binary file with space 
  43. for 450k entries and it took about 5 meg.
  44.  
  45.  
  46.  
  47. *Memory based.
  48.  
  49. Memory based bookfiles are produced just like GDX based.
  50.  
  51.  
  52.  
  53. Misc.
  54.  
  55. You can add entries to an existing binary file. If the binary file exists the entries in the text file
  56. will be added to the binary file.
  57.  
  58.  
  59. If possible use a memory based file system when generating a binary book file. It will go much faster.
  60.  
  61.  
  62. Syntax of text book files
  63. -------------------------
  64.  
  65. Text book files are used to generate the binary book file. You must follow a special
  66. text book file syntax while adding an opening line. The book file parser (program that
  67. interpretes the text book moves) is abble to accept several common Shogi notations.
  68. It also allows to include comments.
  69.                                   
  70. All characters in a line following a '#' character are comments. 
  71. The moves of an opening line is always between two lines with a '#' as its first
  72. character. So, you must not use 1st-column-'#'-comments to give comments to an
  73. opening line. "in-opening" comments are included in brackets ('[' ... ']').
  74. After each ply, you can add a comment in parantheses ('(' ... ')'). 
  75. This is normally used in Shogi notations to indicate the amount of time used by 
  76. the player to enter that move. 
  77.  
  78. There are several possibilites to describe a move. Examples are
  79.  
  80.    7g7f P7f P7g-7f P-7f 
  81.    3c3d +B3cx3d +Bx3d +B3d 
  82.    2d2c+ P2c+ P2dx2c+ Px2c+
  83.  
  84. When you use a character to indicate the piece type, you have to observe
  85. whether the piece is promoted or not, i.e for a promoted piece you have to
  86. indicate this using a '+'. In Shogi notations, the '+' for promoted pieces
  87. may be important in order to avoid ambiguities.
  88.  
  89. For example
  90.    
  91.    #
  92.    # Double Fortess
  93.    P7f P8d
  94.    [ this is an "in-opening" comment ]
  95.    S6h P8e(1)
  96.    # this is an "off-opening" comment
  97.  
  98. defines an opening line with two moves (four plys). The first comment line above an
  99. opening line serves as the name of the opening line. This name is used in case of
  100. errors in the opening line.  
  101.  
  102. You can use move numbers given as a decimal number followed by a '.'.
  103.  
  104. You can indicate good and bad moves using the character combinations 
  105.   ? ?? ?! ! !! !? !?/?! ?!/!?
  106. They have the same meaning as in chess. The characters must directly follow a move,
  107. i.e. there must be no spaces between the move and the bad/good indicator.
  108.   P5e-5d? is correct, while P5e-5d ? is incorrect.
  109. The indicators can be seen as a comment with one exception: if the first character
  110. of the indicator is a '?', the move is marked as BAD_MOVE by the program and it
  111. is not used by the computer if the computer has the option to make this move.
  112.  
  113. You can add some words which indicate the end of a game. These words are
  114.   Resigns Sennichite Jishogi 1-0 0-1
  115. "Sennichite" means "draw by repitition and "Jishogi" means "impasse".
  116.  
  117. Several text book openings are given in the "misc" directory of this distribution.
  118. Some of them have comments, and it could be very useful to study the comments
  119. in order to improve your play or learn how to play Shogi.   
  120.  
  121.  
  122. Adding new opening lines
  123. ------------------------
  124.  
  125. You can add opening lines to the binary book file as noted above. Another possibility
  126. is to build a text book file adding this name to the list of text book files in
  127. the src/Makefile. With "make gnushogi.book.data" you can recreate the binary book.
  128. Use "make install" in order to copy the binary book file to its destination.
  129.                                  
  130.  
  131. Request
  132. -------
  133.  
  134. If you add new opening lines, please make them available to the
  135. GNU Shogi community. Thank you.
  136.  
  137.  
  138.